package com.yanqu.road.server.timer.marriage;

import com.yanqu.road.server.manger.marriage.MarriageMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class CheckApplyOverTimeTask extends GeneralTask {

	private Logger logger = LogManager.getLogger(this.getClass().getName());

	private boolean isRun = false;

	@Override
	public void doRun() {
		if(!isRun) {
			isRun = true;
			try {
				MarriageMgr.checkApplyOverTime();
			}catch (Exception e){
				logger.error("check marriage apply over time error:", e);
			}finally {
				isRun = false;
			}
			try {
				MarriageMgr.checkCrossApplyOverTime();
			}catch (Exception e){
				logger.error("check cross marriage apply over time error:", e);
			}finally {
				isRun = false;
			}
		}
	}
}
